package com.cskaoyan.bean.vo;

import com.cskaoyan.utils.OrderStatus;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author break_a_leg
 * @description
 * @date 2021年10月21日 22:58
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class WxHandleOption {

    private Boolean cancel;

    private Boolean delete;

    private Boolean pay;

    private Boolean comment;

    private Boolean confirm;

    private Boolean refund;

    private Boolean rebuy;

    private Boolean aftersale;

    public static WxHandleOption setValue(String orderStatusText) {
        if (OrderStatus.UN_PAID.getMsg().equals(orderStatusText)) {
            return new WxHandleOption(true,false,true,false,false,false,false,false);
        } else if (OrderStatus.USER_CANCEL.getMsg().equals(orderStatusText) || OrderStatus.SYSTEM_CANCEL.getMsg().equals(orderStatusText)) {
            return new WxHandleOption(false,true,false,false,false,false,false,false);
        } else if (OrderStatus.PAID.getMsg().equals(orderStatusText)) {
            return new WxHandleOption(false,false,false,false,false,true,false,false);
        } else if (OrderStatus.USER_RECEIVED.getMsg().equals(orderStatusText) || OrderStatus.SYSTEM_RECEIVED.getMsg().equals(orderStatusText)) {
            return new WxHandleOption(false,true,false,true,false,false,true,true);
        } else if (OrderStatus.SHIPPED.getMsg().equals(orderStatusText)) {
            return new WxHandleOption(false,false,false,false,true,false,false,false);
        } else if (OrderStatus.COMMENTED.getMsg().equals(orderStatusText)) {
            return new WxHandleOption(false,false,false,false,false,false,true,true);
        }
        return null;
    }
}
